package ink.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-06-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("coupon_user")
@NoArgsConstructor
public class CouponUser implements Serializable {

    private static final long serialVersionUID = 1L;

    public CouponUser(Integer couponId, Integer userId, Date expiresTime, String status) {
        this.couponId = couponId;
        this.userId = userId;
        this.expiresTime = expiresTime;
        this.status = status;
    }

    /**
     * 用户优惠券映射主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 优惠券id
     */
    @TableField("coupon_id")
    private Integer couponId;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 失效时间
     */
    @TableField("expires_time")
    private Date expiresTime;

    /**
     * 状态(可用/锁定/已用)
     */
    @TableField("status")
    private String status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


}
